#ifndef DUILIB_OBJECT_H
#define DUILIB_OBJECT_H
namespace DuiLib
{

class Object
{
public:
	Object(bool inInitialRef=0) : mRefCount(inInitialRef?1:0) { }
	Object *IncRef() { mRefCount++; return this; }
	void DecRef() { mRefCount--; if (mRefCount<=0) delete this; }
    int GetRefCount() { return mRefCount; }
    void *duiObjectRef;
	void* haxeObjectRef;
protected:
	virtual ~Object() { }
    int mRefCount;
};

} // end namespace


#endif
